<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<%@ include file="html-header.jsp"%>
<style type="text/css">
<%@ include file="../stylesheets/main.css"%>
<%@ include file="../stylesheets/header.css"%>
<%@ include file="../stylesheets/footer.css"%>
<%@ include file="../stylesheets/indexContent.css"%>
<%@ include file="../stylesheets/carousel.css"%>
</style>
<!--script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../js/jquery.liquidcarousel.js"></script-->
</head>
<body>
	<div id="left-column-outer">
		<div id="left-column"></div>
	</div>

	<div id="center-column">
		<div class="CenteredContainer">
			<img id="background_noresize" alt="background_noresize"
				src="/Browarex/img/background.jpg">
			<%@ include file="header.jsp"%>
			<div class="ContentShade"></div>
			<div class="ContentContainer">
			    <table class="det" id="beerQueryResults">
			    <tr>
			    	<td>
			    		<span class="ProductTableDesc">Wynik wyszukiwania:</span>
			    	</td>
			    </tr>
			        <tr>
			            <c:forEach items="${foundedProduct}" var="product" varStatus="loop"> 
				            <c:if test="${not loop.first and loop.index % 3 == 0}"> 				            
				                </tr>
				                    <tr>
				            </c:if>
				            <td class="ProductTableCell">
					            <div>
					            <sf:form method="post" commandName="orderProductInfo"
											action="addToBasket">
					            	<img class="BeerImage" alt="Beer Image" src="getImage?imageId=${product.id}"/>
					            	<span class="ProductInfo Title">${product.productName}</span>
									<!--span class="ProductInfo"><s:message code="product.type" />${product.type}</span> <br /--> 
									<!--span class="ProductInfo"><s:message code="product.voltage" />${product.voltage}</span><br /--> 
									<span class="ProductInfo Capacity">${product.capacity}l</span><br /> 
									<!--span class="ProductInfo Type"><s:message code="product.packageType" />${product.packageType.value}</span><br /-->
									<span class="ProductInfo"><s:message code="product.price" />${product.price} <s:message code="label.PLN" /></span><br />
									<span class="ProductInfo Availability"><s:message code="label.dostepnosc"/> ${product.quantity}</span><br/>
										<sf:hidden path="product.id" value="${product.id}" />
										<!--s:message code="label.ilosc" /-->
										<input name="quantity" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'<s:message code="label.ilosc"/>':this.value;" value="<s:message code="label.ilosc"/>" class="LabelOrder" />
										<input type="submit" value="<s:message code="button.addToBasket"/>" class="OrderButton">
										<c:if test="${product.id == orderProductInfo.product.id}">
											<sf:errors style="color: red; float: right;" path="product.quantity" />
										</c:if>
									</sf:form>
								</div>
							</td>
		          		</c:forEach>
	           		</tr>
	           	</table>
	           	<div id="beerTableNavPos"></div>
			</div>
			<%@ include file="footer.jsp"%>
		</div>
	</div>

	<div id="right-column-outer">
		<div id="right-column"></div>
	</div>
</body>
</html>
<script type="text/javascript"><!--
    var pager = new Pager('beerQueryResults', 4); 
    pager.init(); 
    pager.showPageNav('pager', 'beerTableNavPos'); 
    pager.showPage(1);
//--></script>